package com.baizhi.service.impl;

import com.baizhi.entity.Address;
import com.baizhi.mapper.AddressMapper;
import com.baizhi.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper mapper;
    @Override
    public List<Address> selectAddressByUserId(Integer id) {
        return mapper.selectAddressByUserId(id);
    }

    @Override
    public void addAddress(Address address) {
        mapper.addAddress(address);
    }

    @Override
    public void updateAddress(Address address) {
        mapper.updateAddress(address);
    }

    @Override
    public void removeAddress(Integer id) {
        mapper.removeAddress(id);
    }
}
